{extend name="public:layout" /}
{block name='title'}我的举报{/block}
{block name='head'}
<link rel="stylesheet" href="/public/plugins/emoji/lib/css/jquery.mCustomScrollbar.min.css"/>
<link rel="stylesheet" href="/public/plugins/swiper/css/swiper.css"/>
<link rel="stylesheet" href="/public/plugins/emoji/dist/css/jquery.emoji.css"/>
<link rel="stylesheet" href="/public/plugins/dropload/dropload.css">
<style>
    .topbar {
        background: #333;
        color: #fff;
        padding: 10px 8px 6px 8px;
    }
</style>
<style>
</style>
{/block}
{block name="body"}
<div class="mcm-head">
    <div class="head-left">
        <a href="javascript:history.back(-1)" class="link">
            <span class="iconfont icon-zuoyou1"></span>
        </a>
    </div>
    <div class="head-title">
        我的举报
    </div>
</div>
<div style="height:50px;"></div>
<div class="circleinfo-list" id="list">
</div>
<div id="page"></div>
{/block}
{block name='js'}
<script src="/public/plugins/dropload/dropload.min.js"></script>
<script src="/public/plugins/template/template.js"></script>
<script type="text/html" id="list-tpl">
    {{ each data as value index }}
    <div class="info-item">
        <div class="infobox" style="padding-left:0;">
            <div class="info-text">
                <div class="text">{{ value.remsg}}</div>
            </div>
            <div class="info-after">
                <div class="source">举报信息：
                        {{value.msg}}
                    <br>
                    举报时间：{{ value.create_time}}
                    <br>
                    回复时间：{{ value.update_time}}
                </div>
            </div>

        </div>
    </div>
    {{ /each}}
</script>
<script>
    $(function () {
        // 页数
        var data = {
            page: 0
        };
        // dropload
        var drop = $('#page').dropload({
            scrollArea: window,
            loadDownFn: function (me) {
                data.page++;
                // 拼接HTML
                var result = '';
                $.ajax({
                    url: "{:url('report')}",
                    data: data,
                    success: function (res) {
                        if (data.page >= res.last_page) {
                            // 锁定
                            me.lock();
                            // 无数据
                            me.noData();
                        }
                        var html = template('list-tpl', res);
                        $('#list').append(html);
                        me.resetload();
                    },
                    error: function (xhr, type) {
                        layer.open({
                            content: '加载出错'
                            , skin: 'msg'
                            , time: 2 //2秒后自动关闭
                        });
                        // 锁定
                        me.lock();
                        // 无数据
                        me.noData();
                        me.resetload();
                    }
                });
            }
        });
    });
</script>
{/block}